﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Barotrauma;
using Microsoft.Xna.Framework;
using HarmonyLib;

namespace DSSI
{
    public partial class Plugin : IAssemblyPlugin
    {
        [HarmonyPatch(declaringType: typeof(GameSession))]
        [HarmonyPatch(methodName: nameof(GameSession.StartRound))]
        [HarmonyPatch(argumentTypes: new Type[] {
            typeof(LevelData),
            typeof(bool),
            typeof(SubmarineInfo),
            typeof(SubmarineInfo),
        })]
        class GameSession_StartRound
        {
            [HarmonyPrefix]
            static void PreInit(GameSession __instance)
            {
                GameMain.LuaCs.Hook.Call("dssi.gamesession.startround.preinit", __instance.SubmarineInfo);
            }
        }
    }
}
